<?php 
/**
 * @Author: Zheng_Great
 * @Date: 2018-12-13 10:39:23
 * @Description: 这个类是用来实现，API （接口）类。 
 */

namespace frontend\models;

use Yii;
use yii\httpclient\Client;

class ApiRealize{

	public function getArtall(){

        $couponAPI =  Yii::$app->params['apiUrl']['ApiArticle'];
        $client = new Client(['baseUrl' => Yii::$app->params['yiidemoBaseURL']]);//

        $Response =  $client->createRequest()
            ->setFormat(Client::FORMAT_JSON)
            // ->addHeaders([ Yii::$app->params['XWKT_secret_key'] => Yii::$app->params['XWKT_secret_value']])
            ->setUrl($couponAPI)
            ->send();
        return $Response->getData();
	}



}



 ?>